package com.jtyoui.bean;

import java.util.*;

/**
 * 词语对象类
 *
 * @author jtyoui
 * @version 18.5.10
 */
public class Words {

    private String key;//候选词
    private int total;//候选词出现的次数
    private float frequency;//关键字出现的频率
    private float solidify;//凝固程度
    private float free;//自由程度
    private float shift;//偏移度
    private List<Character> leftWord = new ArrayList<>();//左邻字集合
    private List<Character> rightWord = new ArrayList<>();//右邻字集合
    private Map<Character, Integer> leftCount = new HashMap<>();//左邻字概率
    private Map<Character, Integer> rightCount = new HashMap<>();//右邻字概率


    public float getFrequency() {
        return frequency;
    }

    public float getSolidify() {
        return solidify;
    }

    public float getFree() {
        return free;
    }

    public List<Character> getLeftWord() {
        return leftWord;
    }

    public List<Character> getRightWord() {
        return rightWord;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public void setLeftWord(char leftWord) {
        this.leftWord.add(leftWord);
    }

    public float getShift() {
        return shift;
    }

    public void setShift(float shift) {
        this.shift = shift;
    }

    public void setRightWord(char rightWord) {
        this.rightWord.add(rightWord);
    }

    public void setFrequency(float frequency) {
        this.frequency = frequency;
    }

    public void setSolidify(float solidify) {
        this.solidify = solidify;
    }

    public void setFree(float free) {
        this.free = free;
    }

    public String getKey() {
        return key;
    }

    public Map<Character, Integer> getLeftCount() {
        return leftCount;
    }

    public Map<Character, Integer> getRightCount() {
        return rightCount;
    }

    public void setKey(String key) {
        this.key = key;
    }


    public void setLeftCount(Character key,int value) {
        this.leftCount.put(key,value);
    }

    public void setRightCount(Character key,int value) {
        this.rightCount.put(key,value);
    }

    @Override
    public String toString() {
        return "Words{" +
                "key='" + key + '\'' +
                ", total=" + total +
                ", frequency=" + frequency +
                ", solidify=" + solidify +
                ", free=" + free +
                ", shift=" + shift +
                ", leftWord=" + leftWord +
                ", rightWord=" + rightWord +
                ", leftCount=" + leftCount +
                ", rightCount=" + rightCount +
                '}';
    }
}
